<script>
export default {
  name: "pageBase",
  data() {
    return {
      showHeader: true,
    }
  },
  methods: {
    changeHeader() {
      if ('showHeader' in this.$route.meta) {
        this.showHeader = this.$route.meta.showHeader
        return
      }
      this.showHeader = true
    }
  },
  watch: {
    '$route': function () {
      this.changeHeader()
    }
  },
  mounted() {
    this.changeHeader()
  }
}
</script>

<template>
  <van-list style="background-color: rgb(248,248,248);height: 100%">
    <van-nav-bar v-if="showHeader" :title="this.$route.meta.title" safe-area-inset-top @click-left="$router.go(-1)">
      <template #left>
        <van-icon name="arrow-left" style="font-size: 16px;font-weight: bold"/>
      </template>
    </van-nav-bar>
    <keep-alive include="createOrder">
      <router-view/>
    </keep-alive>
  </van-list>
</template>

<style scoped>

</style>